home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 513 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.1 KB

  1. Path: news.sprintlink.net!datalytics!news
  2. From: Rob Stewart <stew@datalytics.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: MFC v.s. OWL class libraries
  5. Date: 4 Jan 1996 20:52:57 GMT
  6. Organization: Datalytics, Inc
  7. Message-ID: <4chen9$ldg@gold.datalytics.com>
  8. References: <4cbkfq$255@charm.magnus.acs.ohio-state.edu>
  9. NNTP-Posting-Host: pc071.datalytics.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. James Saunders <saunders@cfm.ohio-state.edu> wrote:
  16. >Would somebody please comment on the relative strengths and weaknesses of 
  17. >these two class libraries?
  18. >I am curious to know if MFC is becoming the library of choice for windows 
  19. >development.
  20. >We currently use BC++ 4.52, and we are considering getting VC++ 4.0 for 
  21. >future development, mainly because the MFCes appears to be more widely 
  22. >used for current development, and this is likely to become more true.  
  23. >Are we wrong in our conclusions?
  24. >
  25.  
  26. The Zenith Z-100 was a better machine than the IBM PC.  The 
  27. Beta videotape format is (nearly was) a better format than the 
  28. VHS format.  Better isn't always the winner.
  29.  
  30. I have no experience with OWL, so I will only discuss MFC.  
  31. (First, my bias:  I came from the UNIX world to Windows 
  32. development.  I've been working with Win32 and MFC for 
  33. slightly more than a year now.)
  34.  
  35. MFC is a thinly veiled C++ wrapper around the Win32 SDK C 
  36. functions and data structures.  (I won't get into naming 
  37. conventions--that's another long story.)  If you are familiar 
  38. with the Win32 SDK, you'll find it pretty straightforward 
  39. migrating to MFC's peculiar brand of C++ code.
  40.  
  41. On the other hand, if you're not particularly familiar with 
  42. the Win32 SDK and you thought OOA/OOD/OOP meant things like 
  43. encapsulation, inheritance, polymorphism, etc., you'll be 
  44. disappointed in what you see in the MFC classes.  Microsoft 
  45. makes great use of public data members, oddly named member 
  46. functions (same name as in the SDK, but not entirely 
  47. appropriate in the object.function paradigm), non-functional 
  48. constructors, ridiculous compilations of functionality in 
  49. one class, variable const-correctness, etc.
  50.  
  51. MS uses c'tors to little or nothing in most of its classes.  
  52. You must call another member function to do the "real" 
  53. initialization.  This makes it easy enough to make arrays of 
  54. such objects, but they could have provided an overloaded c'tor 
  55. in each case to do the initialization at construction (by 
  56. calling the initialization function--tough job to code it, 
  57. huh?).
  58.  
  59. One of the most ridiculous things they do is to self delete 
  60. objects.  A number of their classes must be allocated on the 
  61. heap.  Upon receipt of certain Windows messages, these objects 
  62. delete themselves from the heap.  Try debugging that!
  63.  
  64. In summary, MS made no attempt to build a decent OO framework.  
  65. They wrapped a bunch of C functions to simplify some things 
  66. and make some things more type safe.  They did not capitalize 
  67. on inheritance in the many places they should have (a combo 
  68. box is not derived from a list box, for example).
  69.  
  70. -- 
  71. Robert Stewart        | My opinions are usually my own.
  72. Datalytics, Inc.
  73. (513)226-7700
  74. stew@datalytics.com
  75.  
  76.  
  77.